package com.caozf.prototype;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * 创建时间：2019/9/14 16:37
 * 创建人:曹子方
 */
public class PrototypeTest {
    public static void main(String[] args) {
        Attachement attachement=new Attachement();
        attachement.setCreatetime(new Date());
        attachement.setFilePath("D:/email/test.txt");
        List<Attachement> list=new ArrayList<Attachement>();
        list.add(attachement);
        Email email=new Email("test","email content");
        email.setToUser("to_1@qq.com");
        email.setFromUser("from_1@qq.com");
        email.setAttachements(list);

        Email email_2=(Email) email.clone();
        email_2.setToUser("to_2@qq.com");
        System.out.println(email.getAttachements());
        System.out.println(email_2.getAttachements());
        System.out.println(email);
        System.out.println(email_2);
    }
}
